package com.leeon.container.map;

import com.leeon.container.iterator.Gobil;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import static net.mindview.util.Print.print;


public class GobilMap {

    private String[] keys = {"aaaa","bbb","ccc","ddd","eeee","ffff","gggg"};

    private  Map<String,Gobil> map = new HashMap<String, Gobil>();

    public static void main(String[] agrs){
        GobilMap gobilMap = new GobilMap();
        for (int i = 0; i < gobilMap.keys.length; i++) {
            Gobil gobil = new Gobil(i);
            gobilMap.map.put(gobilMap.keys[i],gobil);
        }
        print(gobilMap.map);

        Iterator<String> it = gobilMap.map.keySet().iterator();
        while (it.hasNext()){
            String key = it.next();
            System.out.println(key);
            Gobil gobil = gobilMap.map.get(key);
            gobil.hop();
        }
    }

}
